package org.itboys.core.controller.web;

import org.itboys.core.dao.coupon.SundayCouponReceiveMapper;
import org.itboys.core.entity.mysql.SundayCouponReceive;
import org.itboys.core.service.mysql.web.SundayCouponReceiveService;
import org.itboys.core.service.mysql.web.SundayCouponService;
import org.itboys.framework.query.JsonPageUtils;
import org.itboys.framework.spring.controller.BaseController;
import org.itboys.param.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Author：贾琦磊
 * @Date：2018/8/30
 * @Description：
 */
@Controller
@RequestMapping("/sunday/web/coupon/receive")
public class SundayCouponReceiveController extends BaseController{
    @Autowired
    private SundayCouponReceiveService couponReceiveService;


    @RequestMapping("/index")
    public String index(HttpServletRequest request,HttpServletResponse response){
        return "/sunday/coupon/receive/index";
    }
    @RequestMapping("/select")
    public void select(HttpServletRequest request,HttpServletResponse response)throws Exception{
        PageResult<SundayCouponReceive> result = couponReceiveService.select(request);
        JsonPageUtils.renderJsonPage(result.getTotal(),result.getData(),response);
    }
}
